package cn.etynit.feign;
import cn.etynit.fallback.MovieServiceFallbackFactory;
import cn.etynit.result.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "service-movie",path = "/movieTicket",contextId = "movieService",fallbackFactory = MovieServiceFallbackFactory.class)
public interface MovieService {
    @RequestMapping(value = "/list",method = RequestMethod.GET)
    JsonResult list();

    @RequestMapping(value = "/{id}",method = RequestMethod.GET)
    JsonResult get(@PathVariable("id")Long id);

    @RequestMapping(value = "/buy/{movieId}/{count}",method = RequestMethod.GET)
    JsonResult byMovie(@PathVariable Long movieId,@PathVariable Long count);

    @RequestMapping(value = "/giving/{movieId}/{count}/{userId}",method = RequestMethod.GET)
    JsonResult giving(@PathVariable Long movieId,@PathVariable Long count,@PathVariable Long userId);
}
